{
  "swagger": "2.0",
  "info": {
    "title": "api/v1/scsm.spec.proto",
    "version": "version not set"
  },
  "tags": [
    {
      "name": "SecretManagerService"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/v1/secrets": {
      "get": {
        "operationId": "SecretManagerService_ListSecrets",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListSecretsResponse"
            }
          }
        },
        "parameters": [
          {
            "name": "parentId",
            "description": "обязательное поле. Идентификатор родительского сервис инстанса.",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "page.limit",
            "description": "обязательное поле. Максимальное кол-во записей в одном запросе. (Макс: 1000, по-умолчанию: 100).",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "page.offset",
            "description": "обязательное поле. Сдвиг записей.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "SecretManagerService"
        ]
      },
      "post": {
        "operationId": "SecretManagerService_CreateSecret",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1Secret"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateSecretRequest"
            }
          }
        ],
        "tags": [
          "SecretManagerService"
        ]
      }
    },
    "/v1/secrets/{secret.id}": {
      "patch": {
        "operationId": "SecretManagerService_UpdateSecret",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1Secret"
            }
          }
        },
        "parameters": [
          {
            "name": "secret.id",
            "description": "идентификатор секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "description": "обязательное поле. Обновленный секрет.",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1Secret"
            }
          },
          {
            "name": "updateMask",
            "description": "обязательное поле. Маска обновления ключа.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "SecretManagerService"
        ]
      }
    },
    "/v1/secrets/{secretId}": {
      "get": {
        "operationId": "SecretManagerService_GetSecret",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1Secret"
            }
          }
        },
        "parameters": [
          {
            "name": "secretId",
            "description": "обязательное поле. Идентификатор секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "SecretManagerService"
        ]
      },
      "delete": {
        "operationId": "SecretManagerService_DestroySecret",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "properties": {}
            }
          }
        },
        "parameters": [
          {
            "name": "secretId",
            "description": "обязательное поле. Идентификатор секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "SecretManagerService"
        ]
      }
    },
    "/v1/secrets/{secretId}/versions": {
      "get": {
        "operationId": "SecretManagerService_ListSecretVersions",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListSecretVersionsResponse"
            }
          }
        },
        "parameters": [
          {
            "name": "secretId",
            "description": "Обязательное поле. Идентификатор секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "page.limit",
            "description": "обязательное поле. Максимальное количство записей в одном запросе. (Макс: 1000, по-умолчанию: 100).",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "page.offset",
            "description": "обязательное поле. Сдвиг записей.",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          }
        ],
        "tags": [
          "SecretManagerService"
        ]
      },
      "post": {
        "operationId": "SecretManagerService_CreateSecretVersion",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SecretVersion"
            }
          }
        },
        "parameters": [
          {
            "name": "secretId",
            "description": "обязательное поле. Идентификатор секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "payload": {
                  "$ref": "#/definitions/v1SecretPayload",
                  "description": "обязательное поле. Секретные данные."
                }
              }
            }
          }
        ],
        "tags": [
          "SecretManagerService"
        ]
      }
    },
    "/v1/secrets/{secretId}/versions/{secretVersionId}": {
      "get": {
        "operationId": "SecretManagerService_GetSecretVersion",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SecretVersion"
            }
          }
        },
        "parameters": [
          {
            "name": "secretId",
            "description": "обязательное поле. Идентификатор секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "secretVersionId",
            "description": "обязательное поле. Идентификатор версии секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "SecretManagerService"
        ]
      },
      "delete": {
        "operationId": "SecretManagerService_DestroySecretVersion",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SecretVersion"
            }
          }
        },
        "parameters": [
          {
            "name": "secretId",
            "description": "обязательное поле. Идентификатор секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "secretVersionId",
            "description": "обязательное поле. Идентификатор версии секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "SecretManagerService"
        ]
      }
    },
    "/v1/secrets/{secretId}/versions/{secretVersionId}/disable": {
      "patch": {
        "operationId": "SecretManagerService_DisableSecretVersion",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SecretVersion"
            }
          }
        },
        "parameters": [
          {
            "name": "secretId",
            "description": "обязательное поле. Идентификатор секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "secretVersionId",
            "description": "обязательное поле. Идентификатор версии секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "SecretManagerService"
        ]
      }
    },
    "/v1/secrets/{secretId}/versions/{secretVersionId}/enable": {
      "patch": {
        "operationId": "SecretManagerService_EnableSecretVersion",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SecretVersion"
            }
          }
        },
        "parameters": [
          {
            "name": "secretId",
            "description": "обязательное поле. Идентификатор секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "secretVersionId",
            "description": "обязательное поле. Идентификатор версии секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "SecretManagerService"
        ]
      }
    },
    "/v1/secrets/{secretId}/versions/{secretVersionId}/payload": {
      "get": {
        "operationId": "SecretManagerService_AccessSecretVersion",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SecretPayload"
            }
          }
        },
        "parameters": [
          {
            "name": "secretId",
            "description": "обязательное поле. Идентификатор секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "secretVersionId",
            "description": "обязательное поле. Идентификатор версии секрета.",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "SecretManagerService"
        ]
      }
    }
  },
  "definitions": {
    "v1CreateSecretRequest": {
      "type": "object",
      "properties": {
        "parentId": {
          "type": "string",
          "description": "обязательное поле. Идентификатор родительского сервис инстанса."
        },
        "name": {
          "type": "string",
          "description": "наименование секрета."
        },
        "description": {
          "type": "string",
          "description": "описание секрета."
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "метки секрета."
        },
        "kmsKeyId": {
          "type": "string",
          "description": "идентификатор ключа шифрования."
        },
        "payload": {
          "$ref": "#/definitions/v1SecretPayload",
          "description": "секретные данные."
        }
      }
    },
    "v1ListSecretVersionsResponse": {
      "type": "object",
      "properties": {
        "versions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1SecretVersion"
          },
          "description": "версии секрета."
        }
      }
    },
    "v1ListSecretsResponse": {
      "type": "object",
      "properties": {
        "secrets": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1Secret"
          },
          "description": "секреты."
        }
      }
    },
    "v1Page": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "format": "int32",
          "description": "обязательное поле. Максимальное кол-во записей в одном запросе. (Макс: 1000, по-умолчанию: 100)."
        },
        "offset": {
          "type": "integer",
          "format": "int32",
          "description": "обязательное поле. Сдвиг записей."
        }
      }
    },
    "v1Secret": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "идентификатор секрета."
        },
        "name": {
          "type": "string",
          "description": "наименование секрета."
        },
        "description": {
          "type": "string",
          "description": "описание секрета."
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "метки секрета."
        },
        "owner": {
          "type": "string",
          "description": "идентификатор владельца секрета."
        },
        "kmsKeyId": {
          "type": "string",
          "description": "идентификатор ключа шифрования."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "дата создания секрета."
        }
      }
    },
    "v1SecretPayload": {
      "type": "object",
      "properties": {
        "data": {
          "type": "string",
          "format": "byte",
          "description": "секретные данные."
        }
      }
    },
    "v1SecretVersion": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int32",
          "description": "идентификатор версии секрета."
        },
        "secretId": {
          "type": "string",
          "description": "идентификатор секрета."
        },
        "state": {
          "$ref": "#/definitions/v1State",
          "description": "состояние версии секрета."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "дата создания версии секрета."
        }
      }
    },
    "v1State": {
      "type": "string",
      "enum": [
        "STATE_UNSPECIFIED",
        "ENABLED",
        "DISABLED",
        "DESTROYED"
      ],
      "default": "STATE_UNSPECIFIED"
    }
  }
}
